The FILE_UNZIP procedure uncompresses ZIP files. The uncompression of individual files within the ZIP file is done using the ZLIB_UNCOMPRESS routine.
This routine is written in the IDL language. Its source code can be found in the file file_unzip.pro in the lib subdirectory of the IDL distribution.
Note: Because of IDL's file I/O limitations, the resulting files and directories will not have any of the original file owner information, permissions (file modes) or time stamps. Instead, the files and directories will have the current file owner and default permissions, and will have a time stamp equal to the current system time.
Here, we ZIP up the resource/fonts subdirectory within the IDL installation, and then UNZIP the file into our current working directory:
dir = FILEPATH('', SUBDIR=['resource','fonts'])
FILE_ZIP, dir, 'idlresources.zip'
FILE_UNZIP, 'idlresources.zip', /VERBOSE
IDL prints:
% fonts\
% fonts\hersh1.chr, 44667 bytes
...
% fonts\tt\ttfont.map, 305 bytes
% Total 61 files, 963401 bytes
% Time elapsed: 0.070999861 seconds.
FILE_UNZIP, File [, DirectoryOut] [, FILES=variable] [, /LIST] [, /VERBOSE]
Set this argument to a scalar string giving the file to unzip.
Set this optional argument to a scalar string giving the output directory. This directory will be created if it doesn't currently exist. If DirectoryOut is not provided then FILE_UNZIP will unzip into File's current directory.
Set this keyword to a named variable. On return, this variable will contain a string array of all of the files that were unzipped.
Set this keyword to perform all of the FILE_UNZIP actions without actually unzipping the file. The list of files can be retrieved using the FILES keyword, while the VERBOSE keyword will output the list of directories and files within the ZIP file.
Set this keyword to output additional information while the routine is executing.
|
8.2.3 |
Introduced |
FILE_GZIP, FILE_GUNZIP, FILE_TAR, FILE_UNTAR, FILE_ZIP, ZLIB_COMPRESS, ZLIB_UNCOMPRESS